package cn.nawang.ebeim.uc.util;
import java.io.File;

import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.graphics.FontData;
import org.eclipse.swt.graphics.RGB;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.printing.PrintDialog;
import org.eclipse.swt.printing.Printer;
import org.eclipse.swt.printing.PrinterData;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.ColorDialog;
import org.eclipse.swt.widgets.DirectoryDialog;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.FileDialog;
import org.eclipse.swt.widgets.FontDialog;
import org.eclipse.swt.widgets.MessageBox;
import org.eclipse.swt.widgets.Shell;

public class ErrorWin {
   public ErrorWin(){
     final Display display = new Display();
     final Shell shell = new Shell(display);
     shell.setText("Dialog Sample");
   //创建消息框对象，使用警告图标并显示是和否按钮
     MessageBox box = new MessageBox( shell ,SWT.ICON_ERROR);
     //设置对话框的标题
     box.setText("提示");
     //设置对话框显示的消息
     box.setMessage("易备安程序已经启动!");
     //打开对话框，将返回值赋给choice
     int choice = box.open();
     if(choice==32){
       display.dispose();
       shell.dispose();
       System.exit(0);
     }
     //打印出所选择的值
     while (!shell.isDisposed()) {
      if (!display.readAndDispatch())
       display.sleep();
     }
     display.dispose();
   }
  
  
  
public static void main(String[] args) {
  new ErrorWin();
  }
}